<?php
namespace App\Console\Commands; use Illuminate\Console\Command; class ResetPassword extends Command { protected $signature = 'reset:password {email} {password}'; protected $description = 'Reset the password of user
Usage: php artisan reset:password user@email.com'; public function __construct() { parent::__construct(); } public function handle() { $sp3d0720 = $this->argument('email'); if (!$sp3d0720) { $this->warn('please input the user\'s email
'); return false; } $sp590011 = \App\User::where('email', $sp3d0720)->first(); if (!$sp590011) { $this->warn("can't find the user: {$sp3d0720} \nplease input the user's email\n"); return false; } $sp4b3985 = $this->argument('password'); $sp590011->password = bcrypt($sp4b3985); $sp590011->save(); $this->info("the password of '{$sp3d0720}' has been set to {$sp4b3985}\n"); return true; } }